package com.lianyun.day01;

public class WhileDemo {
    public static void main(String[] args) {

        /*int x=1;
        while (x<3){
            System.out.println("x="+x);
            x++;

         */
       /* int x = 1;
        int sum = 0;
        while (x<=10){

            sum = sum + x;
            x++;
        }

        System.out.println("sum="+sum);

        */

        int x = 1;
        int count = 0;

        while (x<=100) {
            System.out.println("当前遍历到的x值 => " + x);
            if (x%6==0) {
                System.out.println("当前遍历到的值满足是6的倍数这个条件 => " + x);
                count = count + 1;
                System.out.println("计分板加1。。。");
            }
            else {
                x = x + 1;
                System.out.println("继续遍历x => " + x);
            }
        }
        System.out.println("count="+count);
    }
}
